package com.damon.activiti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;

/**
 * 启动流程实例
 * @Date 2020/4/7 16:34
 * @Created by Damon
 */
public class ActivitiStartInstance {

    public static void main(String[] args) {
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

        RuntimeService runtimeService = processEngine.getRuntimeService();

        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("holiday");


        System.out.println(processInstance.getId());// act_ru_execution
        System.out.println(processInstance.getProcessDefinitionId());// act_hi_procinst
        System.out.println(processInstance.getActivityId());
    }

}
